home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Collection of Tools & Utilities
/
Collection of Tools and Utilities.iso
/
basic
/
orf.zip
/
ORF.DOC
< prev
next >
Wrap
Text File
|
1980-01-04
|
10KB
|
199 lines
'=========================================================================
' Copyright 1987, Frederick G. Volking
' San Francisco, California
' Author may be contacted through Chrisma BBS at (415)349-6576
' This software released as "freeware" by the Author on July 1, 1987.
'=========================================================================
' This code extracted from Omni-Tool-Box: Version: 1.1
'=========================================================================
ORF - Function: Cross Reference & Pretty Printing Source Code
--------------------------------------------------------------------------
Purpose: This function can preform two actions.
1) It will provide a cross-reference listing of all
variables, functions and labels used within a Turbo
Basic source code file. INCLUDE files are also included
and may be nested to any depth allowable by T-Basic.
2) It will perform a "Pretty-Printing" of the Turbo Basic
source code file. Meaning it will indent all generally
accepted logical sections of code (FOR/NEXT - IF/END IF -
WHILE/WEND - etc...)
Syntax: This function is meant to be run as a compiled EXE program.
STRANGE AND MYSTERIOUS ACTIVITIES MAY OCCUR if you try to
run this program directly from Turbo Basic. The source is
provided simply as a means of allowing you to customize and
modify it as desired.
First Compile ...... then Syntax for Usage from DOS:
DOS> ORF tbasfile[.ext][,[orfile[.ext]],[prettyfile[.ext]],[orf#'s]]
Where: tbasfile[.ext] is the Turbo Basic source code file.
If .extn is not specified then .BAS
will be automatically assumed.
orfile[.ext] The name of the file to receive the
cross reference listing. If no file
name is supplied then a duplicate of
the tbasfile name will be automatically
assumed. If no extention is supplied
then an extention of .ORF will be
automatically assumed.
prettyfile[.ext] The name of the file to recieve the
newly created `Pretty' file. If no file
name is specified then a duplicate of the
tbasfile name will be automatically
assumed. If no extention is supplied
then an extention of .ORB will be
automatically assumed.
orf#'s? If a 'Pretty-File' is being created
then setting this flag to "Y" will
force Physical Line Number Remarks
to be automatically added to the
`pretty' file when finished.
Installation: There are a variety of instalation parameters (See below).
Use of the installation option is only valid once the
program has been compiled to an EXE file. This is due to the
fact that the installer subroutine actually uses the EXE file
itself as the data file for receiving the default parameters.
Thus to use the default parameter installation ability
the program must already be compiled to an EXE file and that
EXE file must reside on the current default directory.
In effect, the EXE file Modifies itself via the installation
ability. To this end, if the 2nd code line of the program
(shown below) is modified before compilation then the
Installation Function will fail, because the EXE file is
searched for the occurance of the string "GINKLOV" and the
default parameters are written to the literal string space
immediately following that search string.
INSTALLdefault$="GNIKLOVBASORFORBBAK 1 0 1 0 "
^^^^^^^|-----------------------|
Search Literal String
Running Installation:
FIRST COMPILE THE PROGRAM! Then from DOS enter:
DOS> ORF /d
The OmniReference program will run, will notice the request flag
for installation "/d", and will drop into install mode. The following
screen will be shown;
===screen======screen======screen======screen======screen======screen========
OmniReference - Copyright 1987, Frederick Volking - Ver: 1.10.A
-------------------------------------------------------------------------------
Default Installer
-------------------------------------------------------------------------------
Original Current
1. Default Source file Extention BAS : BAS
2. Default Cross-Reference file Extention ORF : ORF
3. Default Pretty file Extention ORB : ORB
4. Default Back-Up file Extention BAK : BAK
5. Request verification BEFORE Over-Writing any existing file? Y : Y
6. Rename old .BAS file to .BAK and rename .ORB to .BAS? N : N
7. Automatically do `pretty' of file? Y : Y
8. Put Physical line number remarks in `pretty' Files? N : N
Enter Line# to change, <S>ave or <A>bort install:
===screen======screen======screen======screen======screen======screen========
There are 8 default parameters which may be set/reset with this
ability. Each parameter controls a different internal function
executed within the cross-referencer/pretty-printer itself.
The display column labeled "Original" contains the original factory
settings for all parameters. (ie;the settings I thought best!)
The display column labeled "Current" is just that; The the parameter
settings as they currently exist.
To change a parameter, just type in the line number and the new
setting.
Default Parameter Descriptions:
1. Default Source file Extention: Exactly what it says. In the case
that no file extention is specified, then this is the extention of
which will be automatically supplied.
2. Default Cross-Reference file Extention: Same as above except this
is the default extention for the cross reference out put file.
3. Default Pretty file Extention: Again same as above except this is
the `Pretty-file'.
4. Default Back-Up file Extention: In the event you have parameter #6
set to "Yes" then the original file will be automatically renamed
to this file extention when the final renaming occurs.
5. Request verification BEFORE Over-Writing any existing file? While
ORF is processing the source file, it will be writing a variety of
output files. If during this creation of these new files, ORF
happens to discover that a file already exists with the same name
it intends to use, do you want ORF to verify with you that it's
Okay to over-write the existing file? If you set this parameter
to "No" then ORF will not ask and will automatically overwrite any
existing files.
6. Rename old .BAS file to .BAK and rename .ORB to .BAS? If ORF is
creates a new `pretty-print' file, would you like ORF to
automatically rename the old BASic source file to BAKup and the
new Pretty-File to BASic?
7. Automatically do `pretty' of file? Shall ORF au